﻿using System;
using System.Collections.Generic;

class DifferentWords
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter a sentence:");
        string sentence = Console.ReadLine();
        string[] words = sentence.Split(' ');
        Dictionary<string, int> dictionary = new Dictionary<string, int>();
        for (int index = 0; index < words.Length;index++)
        {
            if (dictionary.ContainsKey(words[index]))
            {
                dictionary[words[index]]++;
            }
            else
            {
                dictionary.Add(words[index], 1);
            }
        }
        foreach (var strWord in dictionary)
        {
            Console.WriteLine("{0} {1}", strWord.Key, strWord.Value);
        }
    }
}

